package com.cheetah.start.common.util;

import cn.dev33.satoken.stp.StpUtil;
import com.cheetah.start.common.util.login.BaseLogin;

public class LoginSysUtil implements BaseLogin {

    public static LoginSysUtil get() {
        return new LoginSysUtil();
    }

    @Override
    public int getLoginId() {
        return StpUtil.getLoginIdAsInt();
    }

    @Override
    public void loginPc(Object loginId) {
        StpUtil.login(loginId, "PC");
    }

    @Override
    public void logOut() {
        StpUtil.logout();
    }

    @Override
    public void setName(String name) {
        StpUtil.getSession().set("name", name);
    }
}
